//
//  WCNPiccell.m
//  滚动的任意添加的图
//
//  Created by wsj2015 on 16/2/23.
//  Copyright © 2016年 wsj2015. All rights reserved.
//

#import "WCNPiccell.h"
#import "WCImageView +setImage.h"
#import "WSJImage.h"

@implementation WCNPiccell

- (void)awakeFromNib {
    // Initialization code
    self.transform =CGAffineTransformMakeRotation(M_PI/2);
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)setImageUrl:(NSString *)imageUrl{
//    self.pic.image = [UIImage imageNamed:imageUrl];
    
    _imageUrl = imageUrl;
    defineWeakSelf;
    //给的是网址
//    [self.pic wsjSetImageWithUrl:imageUrl withPlaceImageName:nil];
    [self.pic wsjSetBigImageWithUrl:imageUrl withPlaceImageName:nil successImageBlock:^(UIImage *image) {
       
        WSJImage *wimage =[WSJImage new];
        wimage.bigImage = image;
        weakSelf.pic.image =wimage.thumbImage;
        
    }];
    
  
    
    
    UITapGestureRecognizer *zoom =[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(zoomAction:)];
    //加上手势
    [self.pic addGestureRecognizer:zoom];
    
    
}
- (void)zoomAction:(UITapGestureRecognizer *)g{
    [self.pic zoomImageFromUrl:_imageUrl fromViewController:self.vcDelegate()];
}
- (IBAction)delAction:(id)sender {
    
    if (self.delAction) {
        self.delAction(self.pic.image);
    }
}
- (void)dealloc{

}
@end
